set(CMAKE_MODULE_PATH
    ${CMAKE_MODULE_PATH}
    ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules)

find_package(KDE4 REQUIRED)

find_package(PolkitQt REQUIRED)

include(KDE4Defaults)

add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})

include_directories(${CMAKE_SOURCE_DIR}
                    ${CMAKE_BINARY_DIR}
                    ${KDE4_INCLUDES})

set(netcfgapplet_SRCS
    netcfgapplet.cpp)

qt4_add_dbus_interface(netcfgapplet_SRCS
                       ${CMAKE_CURRENT_SOURCE_DIR}/../helper/org.archlinux.netcfg.xml
                       netcfginterface)

kde4_add_plugin(plasma_applet_netcfg ${netcfgapplet_SRCS})

target_link_libraries(plasma_applet_netcfg
                      ${KDE4_PLASMA_LIBS}
                      ${POLKITQT_LIBRARIES})

install(TARGETS plasma_applet_netcfg
        DESTINATION ${PLUGIN_INSTALL_DIR})

install(FILES plasma-applet-netcfg.desktop
        DESTINATION ${SERVICES_INSTALL_DIR})
